def binaryToDecimal(binaryString):
    num = 0
    l = len(binaryString)
    for c in binaryString:
        num += eval(c)*(2**(l-1))
        l -= 1
    return num

binary = input("请输入一个二进制字符串：")
print(binaryToDecimal(binary))